<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>FileEncoding</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="../css/default.css" rel="stylesheet" type="text/css">
</head>
<body>

<h1>FileEncoding <span class="ver">[AHK_L 42+]</span></h1>

<p>为 <a href="FileRead.htm">FileRead</a>, <a href="FileReadLine.htm">FileReadLine</a>, <a href="LoopReadFile.htm">Loop Read</a>, <a href="FileAppend.htm">FileAppend</a>, 和 <a href="FileOpen.htm">FileOpen</a> 设置默认编码.</p>

<pre class="Syntax">FileEncoding [, Encoding]</pre>
<p>编码可以为下列值的其中一个:</p>
<ul>
  <li><code>UTF-8</code>: Unicode UTF-8, 相当于 CP65001.</li>
  <li><code>UTF-16</code>: Unicode UTF-16, 小端字节顺序. 相当于 CP1200.</li>
  <li><code>UTF-8-RAW</code> 或 <code>UTF-16-RAW</code>: 像上面一样, 但创建新文件时不写入字节顺序标记.</li>
  <li><code>CP<i>nnn</i></code>: 带有数值标识符 <i>nnn</i> 的代码页. 参见 <a href="http://msdn.microsoft.com/en-us/library/dd317756.aspx">代码页标识符</a>.</li>
  <li>为空或省略: 系统默认的 ANSI 代码页, 这也是默认设置.</li>
</ul>

<h3>备注</h3>
<p><code>A_FileEncoding</code> 包含当前设置.</p>

<h3>相关</h3>
<p><a href="FileOpen.htm">FileOpen</a>, <a href="StrPutGet.htm">StrPut/StrGet</a>, <a href="../Compat.htm#FileRead">脚本兼容性</a></p>

</body>
</html>
